package com.ruoyi.xiaoshou.api;


import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.xiaoshou.domain.SaleOrder;
import com.ruoyi.xiaoshou.domain.SaleOrderDetail;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;

import java.util.List;

@FeignClient(contextId = "RemoteSaleOrderDetailService", value = ServiceNameConstants.XIAOSHOU_SERVICE)
public interface RemoteSaleOrderDetailService {

    @PostMapping("/saleOrderDetail/update")
    public int update(@RequestBody SaleOrderDetail saleOrderDetail, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/saleOrderDetail/getSaleOrderDetail")
    R<List<SaleOrderDetail>> getSaleOrderDetail(@RequestBody Integer orderId);

    @PostMapping("/saleOrderDetail/getSaleOrderDetailByProIdAndOrderId")
    SaleOrderDetail getSaleOrderDetailByProIdAndOrderId(@RequestBody SaleOrderDetail saleOrderDetail);
}